//*  番茄每周福利 *//
//* 作者：50009219*//

var status = 0;
var OnlineTime = "parseInt(cm.getOnlineTime())";
var condition = 30;
var random = java.lang.Math.floor(Math.random() * 4);
var a = "#fEffect/CharacterEff/1114000/1/0#"; //红色六芒星
var b = "#fEffect/CharacterEff/1003271/0/0#";
var c = "#fEffect/CharacterEff/1112905/0/0#"; //篮心
var d = "#fEffect/CharacterEff/1002667/0/0#"; //黄星
var e = "#fEffect/CharacterEff/1003252/1/0#"; //音乐
var g = "#fEffect/CharacterEff/1082565/0/0#"; //饼干兔子
var h = "#fUI/Basic/BtHide3/mouseOver/0#";
var f = "#fEffect/CharacterEff/1112904/2/1#";//彩色五角星

var ca = java.util.Calendar.getInstance();
var year = ca.get(java.util.Calendar.YEAR); //获得年份
var month = ca.get(java.util.Calendar.MONTH) + 1; //获得月份
var day = ca.get(java.util.Calendar.DATE);//获取日
var hour = ca.get(java.util.Calendar.HOUR_OF_DAY); //获得小时
var minute = ca.get(java.util.Calendar.MINUTE);//获得分钟
var second = ca.get(java.util.Calendar.SECOND); //获得秒
var weekday = ca.get(java.util.Calendar.DAY_OF_WEEK); //获得星期
var time = new Date();
var sjr = time.getDay();
switch (sjr) {
    case 0:
        var xq = "星期日";
        break;
    case 1:
        var xq = "星期一";
        break;
    case 2:
        var xq = "星期二";
        break;
    case 3:
        var xq = "星期三";
        break;
    case 4:
        var xq = "星期四";
        break;
    case 5:
        var xq = "星期五";
        break;
    case 6:
        var xq = "星期六";
        break;
    default:
}
if (hour > 20) {
    hour -= 20;
    var apm = "下午好";
} else {
    var apm = "上午好";
}
function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (status == 0 && mode == 0) {
        cm.dispose();
        return;
    }
    if (mode == 1) {
        status++;
    } else {
        status--;
    }
    if (cm.getMapId() == 180000001) {
        cm.sendOk("很遗憾，您因为违反用户守则被禁止游戏活动，如有异议请联系管理员.")
        cm.dispose();
    } else if (status == 0) {
        var selStr = "#e#r\t\t\t\t每日限时挑战副本\r\n\r\n#k#n";
        selStr += e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + "\r\n\r\n";
        selStr += "  #b #r#e<★周日挑战★>#n\r\n  #k进入要求:#e#r20个#v4021016##r100个#v4000000#.#n#k等级:#e#r200级.#n#k在线:#e#r100分钟.#n#k组队:#e#r必须3人1线.\r\n#k#n说明:3人都需要20个最高级结晶100个蓝色蜗牛壳才能进入副本入口#e#b（不是直接开始）#n#k.进入入口后点击#r赤虎#k方可组队开始副本.#e#b本副本每天一次.#d#n（P:玩家可分解最高级结晶卖给需要的人哦！）#e\r\n弱智难度副本奖励#v3010794##v3010752##v3010594##v3015051##v3010754##v1112177##v3010947##v3010948##v2431938#(150武器箱子)#v2431926#(150防具箱子)#v1112915#\r\n#k";
        selStr += "  #b#g#e达人难度副本奖励#k：#v4001005##v2434007#(150武器箱子)#v2431926#(150防具箱子)#v4310150#（兑换埃苏武器）#v2049601##v2048723##v3010936##v3010621##v3015328#\r\n#k";
        selStr += "  #b#r#e传说难度副本奖励#k：#v4001005##v2432069##v2434340##v2430817#(埃苏帽子）#v2430818#（埃苏衣服）#v2430819#（埃苏鞋子）#v2430820#（埃苏手套）#v3010832##v3015193#\r\n#k";
        selStr += "  #b" + g + " 提示 - 进行游戏 [ 200 ] 分钟后开放" + g + "\r\n#k";
        selStr += "  #b" + g + " 当前周期 #r[ " + xq + " #b] 已进行游戏：#r" + parseInt(cm.getOnlineTime()) + "#b 分钟 " + g + "\r\n";
        selStr += "\t\t\t\t#e#r#L0#进入副本#l\r\n#k#n\r\n\r\n\r\n";
        selStr += e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + e + "\r\n";
        cm.sendSimple(selStr);2016/4/3
    } else if (status == 1) {
        switch (selection) {
            case 0://奖品
                if (sjr == 6) {//星期六
                    if (parseInt(cm.getOnlineTime()) > 100) {
						if (cm.haveItem(4021016, 20) && cm.haveItem(4000000, 100) && cm.getPlayer().getLevel() > 100) {
							cm.gainItem(4021016, -20);
							cm.gainItem(4000000, -100);
							//cm.gainMeso( - 10000);4000000
							cm.warp(706041710);
						} else {
							cm.sendOk("#r欧巴，请确认你的等级或者物品和#b金币是否达到符合的要求！");
							cm.dispose();
                        }
                    } else {
                        cm.sendOk("\t\t\t\r\n\r\n#e#r1)抱歉！今天进行游戏 [ 600 ] 分钟 未达标！\r\n");
                        cm.dispose();
                    }
                } else {
                    cm.sendOk("\t\t\t\r\n\r\n#e#r抱歉！今天不是 [ 星期六 ] 无法参与！" );
                    cm.dispose();
                }
        }
    }
}